unit Parametro;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Template, DB, Buttons, ComCtrls, ToolWin, StdCtrls, Mask,
  DBCtrls, AppEvnts, Menus, ExtCtrls;

type
  TFormParametro = class(TFormTemplate)
    Label1: TLabel;
    DBEdit1: TDBEdit;
    SpeedButton1: TSpeedButton;
    SaveDialog1: TSaveDialog;
    DBEdit2: TDBEdit;
    Label2: TLabel;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    Label3: TLabel;
    Label4: TLabel;
    DBEdit5: TDBEdit;
    Label5: TLabel;
    procedure FormShow(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormParametro: TFormParametro;

implementation

uses DM, Geral;

{$R *.dfm}

procedure TFormParametro.FormShow(Sender: TObject);
begin
    SetaDataset(dsPrincipal,DMprinc.QueryParametro);
  inherited;
    dsPrincipal.DataSet.Open;
    if dsPrincipal.DataSet.RecordCount > 0 then
        btnNovo.Enabled := False;
end;

procedure TFormParametro.SpeedButton1Click(Sender: TObject);
begin
  inherited;
    SaveDialog1.InitialDir := GetCurrentDir;
    SaveDialog1.Execute;
    DBEdit1.Text := SaveDialog1.FileName;
end;

procedure TFormParametro.SpeedButton2Click(Sender: TObject);
begin
  inherited;
    SaveDialog1.InitialDir := GetCurrentDir;
    SaveDialog1.Execute;
    DBEdit2.Text := SaveDialog1.FileName;
end;

procedure TFormParametro.SpeedButton3Click(Sender: TObject);
begin
  inherited;
    SaveDialog1.InitialDir := GetCurrentDir;
    SaveDialog1.Execute;
end;

end.
